﻿#ifndef JOURNAL_H
#define JOURNAL_H

#include "common/baseeditor.h"
#include "j_additem.h"

namespace Ui {
class Journal;
}

class Journal : public BaseEditor
{
    Q_OBJECT

public:
    explicit Journal(QWidget *parent = nullptr);
    ~Journal();

    void generateMenu();
    void updateView();
    void setHeaderData();
    void updateMonth();
    void updateDate();
    void newItem();
    void save();
    void do_updateDate();
    void do_generateSummary();
    void changeCategory(const QString &category);
    void changeToSchedule();
    void changeToMemo();

protected:
    void keyPressEvent(QKeyEvent *event);

private slots:
    void on_kw_returnPressed();
    void on_listView_doubleClicked(const QModelIndex &index);
    void on_tableView_clicked(const QModelIndex &index);
    void on_tableView_doubleClicked(const QModelIndex &index);
    void on_month_currentTextChanged(const QString &text);

private:
    Ui::Journal *ui;

    QString selectMonth,currentMonth;
    QString selectDate;
    QStringList monthList;
    QStringList dateList;

    int selectId;
    QString category;
    QString previousDetail;
    QStringListModel *listModel;
};

#endif // JOURNAL_H
